/*
 * BlockingQueue.h
 *
 *  Created on: 18/06/2011
 *      Author: wadi
 */

#ifndef BLOCKINGQUEUE_H_
#define BLOCKINGQUEUE_H_
#include "lock.h"
#include "mutex.h"
#include "conditionvariable.h"
#include <queue>
#include <vector>
class BlockingQueue
{
public:
  BlockingQueue();
  virtual ~BlockingQueue();
  void push(std::vector<char> m);
  void closeQueue();
  std::vector<char> take();

private :
  std::queue<std::vector<char> > msgQueue;
  Mutex mutex;
  ConditionVariable cv;
  bool closed;
};

#endif /* BLOCKINGQUEUE_H_ */
